package com.lightjet.macross.biz.portal.dto.controller;


import com.lightjet.macross.biz.portal.dto.GraphNewsDTO;
import com.lightjet.macross.biz.portal.dto.service.ContentService;
import com.lightjet.macross.common.dto.ResponseDTO;
import com.lightjet.macross.common.util.RespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.extern.java.Log;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/pub/api")
@Scope("request")
@Log
@Api(tags="门户网站公开内容相关数据接口集")
public class ContentController {

    @Resource
    private ContentService contentService;

    @RequestMapping(value="/graphnews",method = {RequestMethod.GET,RequestMethod.POST})
    public ResponseDTO<List<GraphNewsDTO>> GetLatestGraphNews(@ApiParam(name = "count",value = "显示数量，默认为5")Integer count)
    {
        return RespUtil.CreateOK(contentService.GetLatestGraphNews(count));
    }

}
